package com.reviewit.model;

import java.io.Serializable;

import org.bson.types.ObjectId;

import com.google.code.morphia.annotations.Entity;
import com.google.code.morphia.annotations.Id;

@Entity("docTypes")
public class DocType implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private ObjectId id;
	private String name;
	private String description;

	public DocType() {

	}

	public DocType(Long id) {
		super();
	}

	public DocType(ObjectId id, String name) {
		super();
		this.id = id;
		this.name = name;
	}

	public ObjectId getId() {
		return id;
	}

	public void setId(ObjectId id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Override
	public int hashCode() {
		int hash = 7;
		hash = 31 * hash + id.hashCode();
		hash = 31 * hash + (null == id ? 0 : id.hashCode());
		return hash;
	}

	@Override
	public boolean equals(Object obj) {
		if(!(obj instanceof DocType)){
	        return false;
	    }
	    return ((DocType)obj).id == this.id;
	}

	@Override
	public String toString() {
		return this.getName();
	}
}